//
//  RDPRModel.swift
//  test-ios
//
//  Created by wyz5204 on 2023/6/7.
//

import Foundation
import GRDB
import ReactiveSwift

class RDPRModel {
    
    static var shared : RDPRModel = RDPRModel()
    
    // 数据库的初始化
    private var dbQueue: DatabasePool
    
    private init (){
        do {
            let dbPathUrl = try FileManager.default.url(for: .applicationSupportDirectory,
                                                        in: .userDomainMask,
                                                        appropriateFor: nil,
                                                        create:true).appendingPathComponent("rd.sqlite")
            dbQueue = try RDDatabase.recreate(dbPathUrl.path)
        }catch {
            fatalError("RDPRModel init is error \(error)")
        }
    }
}
